<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">添加属性:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-name="row[value][]" data-template="customtpl">
            {if $row.specvalue}
            {foreach name="row['specvalue']" item="v"}
                <dd class="form-inline">
                    <label class="control-label col-xs-12 col-sm-2">属性值 </label>
                    <input type="text" name="row[value][]" class="form-control" value="{$v.value}" size="20" placeholder="请输入属性值">
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            {/foreach}
            {else}
                <dd class="form-inline">
                    <label class="control-label col-xs-12 col-sm-2">属性值 </label>
                    <input type="text" name="row[value][]" class="form-control" value="" size="20" placeholder="请输入属性值">
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            {/if}
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
            </dl>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>


<script type="text/html" id="customtpl">
    <dd class="form-inline">
        <label class="control-label col-xs-12 col-sm-2">属性值 </label>
        <input type="text" name="row[value][]" class="form-control" value="" size="20" placeholder="请输入属性值">
        <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
        <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
    </dd>
</script>